//
//  DownloadModel.m
//  ebook
//
//  Created by 吴超飞 on 16/5/26.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import "DownloadModel.h"

@implementation DownloadModel

-(instancetype)initWithCoder:(NSCoder *)aDecoder{
    
    if (self = [super init]) {
        self.book = [aDecoder decodeObjectForKey:@"book"];
        self.chapter = [aDecoder decodeObjectForKey:@"chapter"];
        self.chapterList = [aDecoder decodeObjectForKey:@"chapterList"];
        self.downloadType = (DownloadType)[aDecoder decodeIntegerForKey:@"downloadType"];
    }
    return self;
}

-(void)encodeWithCoder:(NSCoder *)aCoder{
    
    [aCoder encodeObject:self.book forKey:@"book"];
    [aCoder encodeObject:self.chapter forKey:@"chapter"];
    [aCoder encodeObject:self.chapterList forKey:@"chapterList"];
    [aCoder encodeInteger:self.downloadType forKey:@"downloadType"];
}

@end
